import Vue from 'vue'
import ElementUI from 'element-ui';
import App from './App.vue'
import router from './router/index';
import store from '@/vuex/store';
import '@a/style/resets.css';
import VueRouter from "vue-router";
import moment from "moment";
import "element-ui/lib/theme-chalk/index.css";
import BreadCrumb from '@/components/commous/BreadCrumb.vue';

Vue.use(ElementUI);
// 处理路由重复点击报错问题
const originPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location,onResolve,onReject){
  if(onResolve || onReject) return originPush.call(this,location,onResolve,onReject)
  return originPush.call(this,location).catch(err=>err)
}

const originReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location,onResolve,onReject){
  if(onResolve || onReject) return originReplace.call(this,location,onResolve,onReject)
  return originReplace.call(this,location).catch(err=>err);
}
// 移动端配置
import "amfe-flexible";

// 引入echarts
import echarts from 'echarts';
// 将其放到Vue的原型对象上
Vue.prototype.$echarts  = echarts;

// import BreadCrumb from '@/components/commous/BreadCrumb.vue'

// // 注册面包屑导航
Vue.component("BreadCrumb",BreadCrumb);

// Vue.prototype.$message = Message;
// 时间处理函数
Vue.prototype.$moment = moment;


// 将vuex的store对象放到Vue  
Vue.store = store;

Vue.config.productionTip = false;
new Vue({
  store,
  router,
  render: h => h(App),
}).$mount('#app')
